package com.ititer.util;

public class IpParser {

	public static long parse(String ip) {
		long value = 0;
		String[] columns = ip.split("\\.");
		long a = Long.valueOf(columns[0]);
		long b = Long.valueOf(columns[1]);
		long c = Long.valueOf(columns[2]);
		long d = Long.valueOf(columns[3]);
		value = a * 256 * 256 * 256 + b * 256 * 256 + c * 256 + d;
		return value;
	}

	//TODO unfinished
	public static String reverse(long value) {
		return "";
	}
}
